/*
 * IndexerPanel.java
 *
 * Created on 19 December 2007, 7:57
 */
package fasea.ui.properties;

import fasea.model.IndexingFolder;
import fasea.model.IndexingFolderList;
import fasea.utils.FileUtil;
import java.io.File;
import java.util.Arrays;
import javax.swing.JFileChooser;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author gvasil
 */
public class PropertiesPanel extends javax.swing.JPanel {

    /**
     * Creates new form IndexerPanel
     */
    PropertiesPanel() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        indexDirectoryPanel = new javax.swing.JPanel();
        indexDirectoryLabel = new javax.swing.JLabel();
        indexTextField = new javax.swing.JTextField();
        indexLabel = new javax.swing.JLabel();
        foldersLabel = new javax.swing.JLabel();
        foldersPanel = new javax.swing.JPanel();
        addFolderButton = new javax.swing.JButton();
        removeFolderButton = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        pathList = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        filetypesLabel2 = new javax.swing.JLabel();
        startButton = new javax.swing.JButton();
        stopButton = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        indexerTextArea = new javax.swing.JTextArea();
        jPanel2 = new javax.swing.JPanel();
        filetypesLabel1 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        lastIndexedLabel = new javax.swing.JLabel();
        indexSizeLabel = new javax.swing.JLabel();
        indexedDocumentsLabel = new javax.swing.JLabel();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable1);

        indexTextField.setEditable(false);
        indexTextField.setText(fasea.constants.Constants.getDefaultIndexDirectoryPath());
        indexTextField.setToolTipText("Absolute path where the Index will be stored");

        org.jdesktop.layout.GroupLayout indexDirectoryPanelLayout = new org.jdesktop.layout.GroupLayout(indexDirectoryPanel);
        indexDirectoryPanel.setLayout(indexDirectoryPanelLayout);
        indexDirectoryPanelLayout.setHorizontalGroup(
            indexDirectoryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(indexDirectoryPanelLayout.createSequentialGroup()
                .addContainerGap()
                .add(indexDirectoryLabel)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 10, Short.MAX_VALUE)
                .add(indexTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 688, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        indexDirectoryPanelLayout.setVerticalGroup(
            indexDirectoryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(indexDirectoryPanelLayout.createSequentialGroup()
                .addContainerGap()
                .add(indexDirectoryPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(indexDirectoryLabel)
                    .add(indexTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        indexLabel.setBackground(new java.awt.Color(102, 102, 255));
        indexLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        indexLabel.setForeground(new java.awt.Color(255, 255, 255));
        indexLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        indexLabel.setText("Index Directory Path");
        indexLabel.setOpaque(true);

        foldersLabel.setBackground(new java.awt.Color(102, 102, 255));
        foldersLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        foldersLabel.setForeground(new java.awt.Color(255, 255, 255));
        foldersLabel.setText("Indexing Folders");
        foldersLabel.setOpaque(true);

        addFolderButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/list-add.png"))); // NOI18N
        addFolderButton.setToolTipText("Add folder");
        addFolderButton.setBorderPainted(false);
        addFolderButton.setContentAreaFilled(false);
        addFolderButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        addFolderButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addFolderButtonActionPerformed(evt);
            }
        });

        removeFolderButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/list-remove.png"))); // NOI18N
        removeFolderButton.setToolTipText("Remove folder");
        removeFolderButton.setBorderPainted(false);
        removeFolderButton.setContentAreaFilled(false);
        removeFolderButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        removeFolderButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeFolderButtonActionPerformed(evt);
            }
        });

        pathList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Path", "Art"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        pathList.getTableHeader().setResizingAllowed(false);
        pathList.getTableHeader().setReorderingAllowed(false);
        jScrollPane3.setViewportView(pathList);

        org.jdesktop.layout.GroupLayout foldersPanelLayout = new org.jdesktop.layout.GroupLayout(foldersPanel);
        foldersPanel.setLayout(foldersPanelLayout);
        foldersPanelLayout.setHorizontalGroup(
            foldersPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(foldersPanelLayout.createSequentialGroup()
                .add(jScrollPane3)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(foldersPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(addFolderButton)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, foldersPanelLayout.createSequentialGroup()
                        .add(removeFolderButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        foldersPanelLayout.setVerticalGroup(
            foldersPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(foldersPanelLayout.createSequentialGroup()
                .add(foldersPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(foldersPanelLayout.createSequentialGroup()
                        .add(12, 12, 12)
                        .add(addFolderButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 29, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(removeFolderButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 29, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(0, 18, Short.MAX_VALUE))
                    .add(jScrollPane3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );

        filetypesLabel2.setBackground(new java.awt.Color(102, 102, 255));
        filetypesLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        filetypesLabel2.setForeground(new java.awt.Color(255, 255, 255));
        filetypesLabel2.setText("Index Control");
        filetypesLabel2.setOpaque(true);

        startButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/media-play.png"))); // NOI18N
        startButton.setBorderPainted(false);
        startButton.setContentAreaFilled(false);

        stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/media-stop.png"))); // NOI18N
        stopButton.setToolTipText("stop indexing");
        stopButton.setBorderPainted(false);
        stopButton.setContentAreaFilled(false);
        stopButton.setEnabled(false);

        indexerTextArea.setColumns(20);
        indexerTextArea.setEditable(false);
        indexerTextArea.setRows(1);
        indexerTextArea.setAutoscrolls(false);
        indexerTextArea.setOpaque(false);
        jScrollPane1.setViewportView(indexerTextArea);

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(filetypesLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(startButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(stopButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jScrollPane1)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(filetypesLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(13, 13, 13)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(stopButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(startButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())
                    .add(jScrollPane1)))
        );

        filetypesLabel1.setBackground(new java.awt.Color(102, 102, 255));
        filetypesLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        filetypesLabel1.setForeground(new java.awt.Color(255, 255, 255));
        filetypesLabel1.setText("Index Information");
        filetypesLabel1.setOpaque(true);

        jLabel1.setText("Last Full Indexing was at:");

        jLabel2.setText("Index Size:");

        jLabel3.setText("Indexed Files:");

        lastIndexedLabel.setText("<empty>");

        indexSizeLabel.setText("<empty>");

        indexedDocumentsLabel.setText("<empty>");

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(filetypesLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(jPanel2Layout.createSequentialGroup()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel1)
                    .add(jLabel2)
                    .add(jLabel3))
                .add(18, 18, 18)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(indexedDocumentsLabel)
                    .add(indexSizeLabel)
                    .add(lastIndexedLabel))
                .add(0, 0, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(filetypesLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(lastIndexedLabel))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(indexSizeLabel))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel3)
                    .add(indexedDocumentsLabel))
                .addContainerGap())
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(foldersPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(indexDirectoryPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(indexLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(foldersLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(indexLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(indexDirectoryPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(foldersLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(foldersPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(5, 5, 5)
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void removeFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeFolderButtonActionPerformed
        int[] selectedRows = this.pathList.getSelectedRows();

        java.util.Arrays.sort(selectedRows);

        javax.swing.table.DefaultTableModel model =
                (javax.swing.table.DefaultTableModel) this.pathList.getModel();

        for (int i = selectedRows.length - 1; i >= 0; --i) {
            model.removeRow(selectedRows[i]);
        }
    }//GEN-LAST:event_removeFolderButtonActionPerformed

    private void addFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addFolderButtonActionPerformed
        JFileChooser chooser = new JFileChooser();
        chooser.setCurrentDirectory(new java.io.File(System.getProperty("user.home")));
        chooser.setDialogTitle("Select Directory");
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            javax.swing.table.DefaultTableModel model = (DefaultTableModel) this.pathList.getModel();

            String path = chooser.getSelectedFile().getPath();
            int len = model.getRowCount();

            while (--len >= 0) {
                if (path.equals(model.getValueAt(len, 0))) {
                    return;
                }
            }

            model.addRow(new Object[]{path,""});
        }


    }//GEN-LAST:event_addFolderButtonActionPerformed

    @Override
    public void setEnabled(boolean b) {
        this.pathList.setEnabled(b);
        this.addFolderButton.setEnabled(b);
        this.removeFolderButton.setEnabled(b);
    }

    void setIndexingFolders(IndexingFolderList folders) {
        javax.swing.table.DefaultTableModel model = (DefaultTableModel)this.pathList.getModel();
        model.setRowCount(folders.size());
        for (int row = 0; row<folders.size(); row ++){
            IndexingFolder folder = folders.get(row); 
            model.setValueAt(folder.getIndexingFolder().getPath(), row, 0);
            model.setValueAt(folder.getFileExtensionRestrictionsAsString(), row, 1);
        }
    }
    
    IndexingFolderList getIndexingFolders() {
        javax.swing.table.DefaultTableModel model = (DefaultTableModel) this.pathList.getModel();
        IndexingFolderList indexingFolders = new IndexingFolderList();
        for(int row=0;row<model.getRowCount();row++){
            String indexingFolderPath = (String) model.getValueAt(row, 0);
            String[] fileExtensions = ((String) model.getValueAt(row, 1)).split(",");
            indexingFolders.add(new IndexingFolder(new File(indexingFolderPath),fileExtensions));
        }
        return indexingFolders;
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addFolderButton;
    private javax.swing.JLabel filetypesLabel1;
    private javax.swing.JLabel filetypesLabel2;
    private javax.swing.JLabel foldersLabel;
    private javax.swing.JPanel foldersPanel;
    private javax.swing.JLabel indexDirectoryLabel;
    private javax.swing.JPanel indexDirectoryPanel;
    private javax.swing.JLabel indexLabel;
    private javax.swing.JLabel indexSizeLabel;
    private javax.swing.JTextField indexTextField;
    private javax.swing.JLabel indexedDocumentsLabel;
    private javax.swing.JTextArea indexerTextArea;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private javax.swing.JLabel lastIndexedLabel;
    private javax.swing.JTable pathList;
    private javax.swing.JButton removeFolderButton;
    private javax.swing.JButton startButton;
    private javax.swing.JButton stopButton;
    // End of variables declaration//GEN-END:variables

    void setIndexAlertIcon() {
        lastIndexedLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/alert-important.png")));
        lastIndexedLabel.setToolTipText("Index is outdated or incomplete. Please start indexer.");
    }

    void setIndexOKIcon() {
        lastIndexedLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/alert-green.png")));
        lastIndexedLabel.setToolTipText("Indexing has been completed successfully.");
    }

    void setIndexRunningIcon() {
        lastIndexedLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/loader.gif")));
        lastIndexedLabel.setToolTipText("Indexing in progess...");
    }

    void enableStartButton(boolean started) {
        startButton.setEnabled(started);
        stopButton.setEnabled(!started);
    }

    void setIndexerStatusText(String text) {
        indexerTextArea.setText(text);
    }

    javax.swing.JButton getAddFolderButton() {
        return addFolderButton;
    }

    javax.swing.JButton getRemoveFolderButton() {
        return addFolderButton;
    }

    javax.swing.JButton getStartButton() {
        return startButton;
    }

    javax.swing.JButton getStopButton() {
        return stopButton;
    }

    void setIndexDirectory(File indexFolder) {
        this.indexTextField.setText(indexFolder.getPath());
    }

    void setLastIndexed(String lastIndexed) {
        this.lastIndexedLabel.setText(lastIndexed);
    }
    
    void setIndexedDocumentsCount(int count){
        this.indexedDocumentsLabel.setText(Integer.toString(count));
    }
    
    void setIndexSize(long size){
        this.indexSizeLabel.setText(FileUtil.adjustSize(size));
    }

    
}
